#ifndef VWINDOWSPLITTER_H
#define VWINDOWSPLITTER_H

/* 在此类中管理会话的生命周期
 * 实时更新会话的信息，激活状态、关闭时间等
*/
#include <QWidget>
#include "VSession.h"

class VWindowSplitter : public QWidget
{
    Q_OBJECT
public:
    explicit VWindowSplitter(QWidget *parent = nullptr);

    void addWidget(QWidget *dst,QWidget *src,Qt::Orientation orientation);
    void removeWidget(QWidget *src);
    VSession *selectSession();

    VSession *vSplitScreen(QString strId);
    VSession *hSplitScreen(QString strId);
signals:
    void sigNoSession(bool bNone);
    void sigSelectSession(QString strId);
    void sigSessionClose(QString strId);
public slots:
    void slotMergeScreen();
protected:
    virtual VSession *newSession(QWidget *parent,QString strId);
    void selectedSession(VSession *pSession);
private:
    VSession *m_pSelected = nullptr;
    QList<VSession *> m_listVSession;
};

#endif // VWINDOWSPLITTER_H
